using MediatR;
using MyServer.Todo.ClientAPI.Application.CommandHandlers.TodoGroupHandlers;
using MyServer.Todo.Domain.Aggregates.TodoGroupAggregate;
using MyServer.Todo.Infrastructure.Repositories;

namespace MyServer.Todo.ClientAPI.Extensions.ConfigureService;

public class ConfigureDI
{
    private readonly IServiceCollection services;
    public ConfigureDI(IServiceCollection services)
    {
        this.services = services??throw new ArgumentNullException(nameof(services));
    }
    /// <summary>
    /// 配置命令处理器
    /// </summary>
    public void ConfigureCommandHandler()
    {
        services.AddScoped<IRequestHandler<CreateTodoGroupCommand, bool>, CreateTodoGroupCommandHandler>();
    }
    /// <summary>
    /// 配置领域事件
    /// </summary>
    public void ConfigureDomainEventHandler()
    {

    }
    /// <summary>
    /// 配置领域服务
    /// </summary>
    public void ConfigureDomainService()
    {
    }
    /// <summary>
    /// 配置仓储
    /// </summary>
    public void ConfigureRepository()
    {
        services.AddScoped<ITodoGroupRepository, TodoGroupRepository>();
    }
    /// <summary>
    /// 配置查询
    /// </summary>
    public void ConfigureQueries()
    {

    }
}
